package com.hd.crdao.activity;

import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.hd.crdao.R;
import com.hd.crdao.base.BaseActivity;
import com.hd.crdao.view.ExpandHeadView;

import butterknife.BindView;
import butterknife.ButterKnife;

import static com.hd.crdao.R.id.amount;

/**
 *
 *@author Administrator
 *@date 2017/8/18 0018
 */

public class DetailsActicity extends BaseActivity {
    @BindView(R.id.details_head)
    ExpandHeadView mDetailsHead;
    @BindView(amount)
    TextView mAmount;
    @BindView(R.id.time)
    TextView mTime;
    @BindView(R.id.remarks)
    TextView mRemarks;
    @BindView(R.id.order_num)
    TextView mOrderNum;
    @BindView(R.id.rate)
    TextView mRate;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_details;
    }

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }

    @Override
    protected void initData() {
        String id = getIntent().getStringExtra("id");
        String prName = getIntent().getStringExtra("PrName");
        String amount = getIntent().getStringExtra("amount");
        String time = getIntent().getStringExtra("time");
        double rate = getIntent().getDoubleExtra("rate", 0);
        String rlT0 = getIntent().getStringExtra("rlT0");
        if(TextUtils.equals("0",rlT0)){
            mRate.setText("T+1(费率"+rate+"%)");
        }else if(TextUtils.equals("1",rlT0)){
            mRate.setText("T+0(费率"+rate+"%)");
        }
        mAmount.setText("+" + amount);
        mTime.setText(time);
        mRemarks.setText(prName);
        mOrderNum.setText(id);
    }

    @Override
    protected void initListener() {
        mDetailsHead.getLeftArrowLL().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
